﻿using CommunityToolkit.Mvvm.ComponentModel;
using ListCompareDemo.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ListCompareDemo.ViewModels
{
    public partial class MainWindowViewModel : ObservableObject
    {
        [ObservableProperty]
        public string title = "List Compare Demo";

        public DataGridSource<RecipeScanPoint> MeasurementPoints { get; set; } = new();

        public MainWindowViewModel()
        {
            List<RecipeScanPoint> scanPoints = new();
            scanPoints.Add(new RecipeScanPoint { X = 1, Y = 2,Dx = 3, Dy = 4 , PatternId = 1});
            scanPoints.Add(new RecipeScanPoint { X = 11, Y = 12,Dx = 13, Dy = 14 , PatternId = 2});
            scanPoints.Add(new RecipeScanPoint { X = 21, Y = 22,Dx = 23, Dy = 24 , PatternId = 3});
            scanPoints.Add(new RecipeScanPoint { X = 31, Y = 32,Dx = 33, Dy = 34 , PatternId = 4});
            scanPoints.Add(new RecipeScanPoint { X = 41, Y = 42,Dx = 43, Dy = 44 , PatternId = 5});
            scanPoints.Add(new RecipeScanPoint { X = 51, Y = 52,Dx = 53, Dy = 54 , PatternId = 6});

            MeasurementPoints.Update(scanPoints);
        }
    }
}
